<template>
  <a-upload
      name="file"
      :multiple="true"
      action="http://42.192.195.63:10086/api/userInfo/uploadLogo"
      :headers="headers"
      @change="handleChange"
  >
    <a-button> <a-icon type="upload" /> Click to Upload </a-button>
  </a-upload>
</template>
<script>
export default {
  data() {
    return {
      headers: {
        token: '1111',
      },
    };
  },
  methods: {
    handleChange(info) {
      console.log("============================")

      // if (info.file.status !== 'uploading') {
      //   console.log(info.file);
      // }
      if (info.file.status === 'done') {
        let logoUrl = info.file.response
        this.$emit("getLogo",logoUrl)
        this.$message.success(`${info.file.name} file uploaded successfully`);
      } else if (info.file.status === 'error') {
        this.$message.error(`${info.file.name} file upload failed.`);
      }
    },
  },
};
</script>
